package be.dch.objectprops.formatter;

import java.math.BigDecimal;

public class BigDecimalFormatter implements Formatter {

    @SuppressWarnings("rawtypes")

    public Class getFormatterClass() {
	return BigDecimal.class;
    }


    public Object parse(final String input) {
	if (input == null) {
	    return null;
	}
	return new BigDecimal(input);
    }

    
    public String format(final Object input) {
	final BigDecimal bd = (BigDecimal) input;
	return bd.toString();
    }

    
    public void parse(final String input, Object result) {
	throw new UnsupportedOperationException("Method parse(String,Object) not supporeted.");
    }

}
